package com.share.user.api;

import com.share.common.core.domain.R;
import com.share.user.domain.UpdateUserLogin;
import com.share.user.domain.UserInfo;
import com.share.user.factory.RemoteUserInfoFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import com.share.common.core.constant.ServiceNameConstants;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;


/**
 * 用户服务
 *
 * @author share
 */
@FeignClient(contextId = "remoteUserInfoService", value = ServiceNameConstants.SHARE_USER, fallbackFactory = RemoteUserInfoFallbackFactory.class)
public interface RemoteUserService {



    /**
     * 小程序授权登录
     */
    @GetMapping("/userInfo/wxLogin/{code}")
    public R<UserInfo> wxLogin(@PathVariable("code") String code);


    /**
     * 更新用户登录信息
     */
    @PutMapping("/userInfo/updateUserLogin")
    public R<Boolean> updateUserLogin(@RequestBody UpdateUserLogin updateUserLogin);

    /**
     * 获取用户详细信息
     */
    @GetMapping("/userInfo/getUserInfo/{id}")
    public R<UserInfo> getInfo(@PathVariable("id") Long id);


    /**
     * 获取用户数量
     */
    @GetMapping(value = "/userInfo/getUserCount")
    public R<Map<String, Object>> getUserCount();
}
